#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton* button=new QPushButton(this);
    button->setText("按钮");
    button->move(200,300);
    // connect(button,&QPushButton::clicked,this,[button,this](){
    //     button->move(200,200);
    //     this->move(100,100);
    //     qDebug()<<"lambda被调用了！";
    // });

    connect(button,&QPushButton::clicked,this,[=](){
        button->move(200,200);
        this->move(100,100);
        qDebug()<<"lambda被调用了！";
    });

}

Widget::~Widget()
{
    delete ui;
}
